/*
 * MenuScene.fx
 *
 * Created on 03.12.2009, 12:02:59
 */

package org.zhgames.zhciv.client.gui.scenes;

import javafx.scene.*;
import javafx.scene.paint.*;
import javafx.scene.shape.*;
import javafx.scene.layout.*;
import javafx.scene.text.*;
import javafx.scene.image.ImageView;
import javafx.scene.image.Image;
import javafx.stage.Alert;
import javafx.geometry.Rectangle2D;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.KeyCode;
import javafx.scene.control.Button;
import java.lang.System;

/**
 * @author Vitaliy_Turilkin
 */

public class MenuScene extends CustomNode{
    public var sceneMaster:SceneMaster;
     override function create():Node {
         return Group{
             focusTraversable:true
             content:[
                     VBox{
                         content: [
                             start_game,
                             load_game,
                             exit_game
                         ]
                     }
                     ]
             onKeyTyped: function( e: KeyEvent ):Void {
                if(e.code == KeyCode.VK_SPACE){
                    println("OK");
                }
             }
         }

     }

    def start_game = Button {
        text: "Start game"
        action: function() {
            sceneMaster.showGameScene();
        }
    }

    def load_game = Button {
        text: "Load game"
        action: function() {
            print("load");
        }
    }

    def exit_game = Button {
        text: "Exit"
        action: function() {
            System.exit(0);
        }
    }
}
